package com.tanhua.model.vo;

import com.tanhua.model.mongo.Option;
import com.tanhua.model.mongo.Question;
import com.tanhua.model.mongo.Soul;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class QuestionVo {

    private String id; //主键id

    private String question;  //试卷的题目

    private List<OptionVo> options;   //这道题目的选项。集合。

    public static QuestionVo init(Question question, List<OptionVo> options) {
        QuestionVo vo = new QuestionVo();
        vo.setId(question.getId().toHexString());
        vo.setQuestion(question.getProblem());
        vo.setOptions(options);
        return vo;
    }


}